﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using GG.Common;
using GG.Base;
using System.Windows.Markup;
using SharpVectors.Converters;

namespace GGSim
{
    //public abstract class Car : CommonCar, IGridDrawable
    public class Car : IGridDrawable
    {
        private TransformGroup group;
        public Car()
        {
            drawing = (DrawingGroup) SvgUtils.getDrawingFromSvg("Car.svg");
            group = new TransformGroup();
            drawing.Transform = group;
            
            group.Children.Add(new TranslateTransform());

            group.Children.Add(new RotateTransform());

            group.Children.Add(new ScaleTransform(1,-1)); // fix flip;
        }

        private DrawingGroup drawing;
        public DrawingGroup Drawing { get { return drawing; } }

        public Point Position { set { group.Children[0] = new TranslateTransform(value.X, value.Y); } get { return new Point(drawing.Transform.Value.OffsetX, drawing.Transform.Value.OffsetY); } }
        public double Rotation { set { group.Children[1] = new RotateTransform(value); } get { return (group.Children[1] as RotateTransform).Angle; } }
        


    }
} 